package com.ykq.system.controller;

import com.ykq.core.entity.Menu;
import com.ykq.core.vo.R;
import com.ykq.system.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: 闫克起
 * @Description:
 * @Date: Create in 11:58 2024/8/12
 */
@RestController
@RequestMapping("system/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/getByUserId/{userId}")
    public R<List<Menu>> getByUserId(@PathVariable Long userId){
        return menuService.selectByUserId(userId);
    }


    @GetMapping("/leftMenu")
    public R<List<Menu>> leftMenu(){
        return menuService.selectLeftMenu();
    }
}












